<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜索框实例</title>
<!-- 样式 -->
<link href="dq_search.css" rel="stylesheet" type="text/css" />
<!-- 数据 -->
<script language="javascript" src="citydata.js" type="text/javascript"></script>
<!-- 搜索函数 -->
<script language="javascript" src="dq_search.js" type="text/javascript"></script>

<!-- 测试实例 -->
<script language="javascript">
function test()
{
	if(!search_checkById("city"))
	{
		alert("姓名1信息不正确");
		return false;
	}
	if(!search_checkById("city2"))
	{
		alert("姓名2信息不正确");
		return false;
	}
	alert("检测通过");
	return true;
}


</script>

</head>

<body>
<form name="f1" method="post">
<!-- sample
@param datasource	数据存储js名称
@param objForSaveId	用于存储id的对象
@param defaultData	默认选项
-->

城市1:
<input name="city" id="city1" type="text" value="" datasource="citydata" objForSaveId="cityid" defaultData="北京|beijing|110100@重庆|chongqing|500000@大连|dalian|210200@广州|guangzhou|440100@上海|shanghai|310100@沈阳|shenyang|210100@苏州|suzhou|320500@天津|tianjin|120000@厦门|xiamen|350200@西安|xian|610100 " onkeyup="search_start(this,event)"  onclick="search_start(this,event)"/>
编号1<input name="cityid" id="cityid" >

城市2
<input name="city" id="city2" type="text" value="" datasource="citydata" objForSaveId="cityid2" defaultData="北京|beijing|110100@重庆|chongqing|500000@大连|dalian|210200@广州|guangzhou|440100@上海|shanghai|310100@沈阳|shenyang|210100@苏州|suzhou|320500@天津|tianjin|120000@厦门|xiamen|350200@西安|xian|610100 " onkeyup="search_start(this,event)"  onclick="search_start(this,event)"/>
编号2<input name="cityid" id="cityid2">

<input type="button" value="测试" onclick="test()">
</form>
<br/><br/>
测试说明：
在城市输入框中输入城市名称(不带引号，可以是拼音)
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));
</script>
</body>
</html>